using System;
using System.Collections.Generic;
using System.Text;
namespace MyDMS.BusinessLayer
{
	public class Department: BusinessObjectBase
	{

		#region InnerClass
		public enum DepartmentFields
		{
			Department_Code,
			Department_Name,
			Location,
			Address,
			Office_Code,
			Is_Active,
			Creation_Date,
			Updation_Date
		}
		#endregion

		#region Data Members

			int _department_Code;
			string _department_Name;
			string _location;
			string _address;
			int _office_Code;
			bool? _is_Active;
			DateTime? _creation_Date;
			DateTime? _updation_Date;

		#endregion

		#region Properties

		public int  Department_Code
		{
			 get { return _department_Code; }
			 set
			 {
				 if (_department_Code != value)
				 {
					_department_Code = value;
					 PropertyHasChanged("Department_Code");
				 }
			 }
		}

		public string  Department_Name
		{
			 get { return _department_Name; }
			 set
			 {
				 if (_department_Name != value)
				 {
					_department_Name = value;
					 PropertyHasChanged("Department_Name");
				 }
			 }
		}

		public string  Location
		{
			 get { return _location; }
			 set
			 {
				 if (_location != value)
				 {
					_location = value;
					 PropertyHasChanged("Location");
				 }
			 }
		}

		public string  Address
		{
			 get { return _address; }
			 set
			 {
				 if (_address != value)
				 {
					_address = value;
					 PropertyHasChanged("Address");
				 }
			 }
		}

		public int  Office_Code
		{
			 get { return _office_Code; }
			 set
			 {
				 if (_office_Code != value)
				 {
					_office_Code = value;
					 PropertyHasChanged("Office_Code");
				 }
			 }
		}

		public bool?  Is_Active
		{
			 get { return _is_Active; }
			 set
			 {
				 if (_is_Active != value)
				 {
					_is_Active = value;
					 PropertyHasChanged("Is_Active");
				 }
			 }
		}

		public DateTime?  Creation_Date
		{
			 get { return _creation_Date; }
			 set
			 {
				 if (_creation_Date != value)
				 {
					_creation_Date = value;
					 PropertyHasChanged("Creation_Date");
				 }
			 }
		}

		public DateTime?  Updation_Date
		{
			 get { return _updation_Date; }
			 set
			 {
				 if (_updation_Date != value)
				 {
					_updation_Date = value;
					 PropertyHasChanged("Updation_Date");
				 }
			 }
		}


		#endregion

		#region Validation

		internal override void AddValidationRules()
		{
			ValidationRules.AddRules(new Validation.ValidateRuleNotNull("Department_Code", "Department_Code"));
			ValidationRules.AddRules(new Validation.ValidateRuleNotNull("Department_Name", "Department_Name"));
			ValidationRules.AddRules(new Validation.ValidateRuleStringMaxLength("Department_Name", "Department_Name",50));
			ValidationRules.AddRules(new Validation.ValidateRuleStringMaxLength("Location", "Location",100));
			ValidationRules.AddRules(new Validation.ValidateRuleStringMaxLength("Address", "Address",500));
			ValidationRules.AddRules(new Validation.ValidateRuleNotNull("Office_Code", "Office_Code"));
		}

		#endregion

	}
}
